#pragma once
#include <fstream>
#include <string>
#include <assert.h>
#include "Lua.h"
#include "MapManager.hpp"
using namespace std;
/*
	This class handles data loading / saving.

	Type: Singleton

*/

#define DataLoader SuperData::Instance()


class SuperData
{
private:

	SuperData();
	SuperData(const SuperData&);
	SuperData& operator =(const SuperData&);
	~SuperData(){};

	// Configuration
	string NavPath;
	string MapPath;
	string MusicName;
	string MapName;
	string MapScriptPath;
	int map_width, map_height;

	// Settings
	int PlayMusic, SoundVolume;
	string MapToNavFileCreatorPath;
	bool fullscreen;



public:
	static SuperData* Instance();
	
	// Configuration Loading
	void					LoadData(const MapData& mapData);

	inline string		GetMapName()					{return MapName;}
	inline string		GetNavPath()					{return NavPath;}
	inline string		GetMapPath()					{return MapPath;}
	inline string		GetMapScriptPath()				{return MapScriptPath;}
	inline string		GetMusicName()					{return MusicName;}
	inline int			GetMapWidth()					{return map_width;}
	inline int			GetMapHeight()					{return map_height;}
	inline bool			IsFullscreen()					{return fullscreen;}


	// Settings Loading
	void					LoadSettings(string filename);

	inline const char*		GetMapToNavFileCreatorPath()	{return MapToNavFileCreatorPath.c_str();}

	inline bool				IsPlayMusicOn()					{return PlayMusic == 1;}
	inline int				GetSoundVolume()				{return SoundVolume;}

	
	int WINDOW_WIDTH, WINDOW_HEIGHT, WINDOW_BPP;
};